using System;
using System.Reflection;
using Microsoft.Practices.ObjectBuilder2;

namespace Common.Unity.Extensions.Entity
{
	[AttributeUsage( AttributeTargets.Class, AllowMultiple = true )]
	public abstract class DefaultPropertyValueAttributeBase : Attribute
	{
		readonly string propertyName;

		public DefaultPropertyValueAttributeBase( string propertyName )
		{
			this.propertyName = propertyName;
		}

		protected internal abstract object GetValue( PropertyInfo property, IBuilderContext context );

		public string PropertyName
		{
			get { return propertyName; }
		}
	}
}